package com.stylefeng.guns.modular.system.dao;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.system.model.NewsCategory;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章类别表 Mapper 接口
 * </p>
 *
 * @author huangyuehong123
 * @since 2018-06-20
 */
public interface NewsCategoryMapper extends BaseMapper<NewsCategory> {

    /**
     * 获取所有的新闻类别
     */
    List<Map<String,Object>> getNewsCategories(@Param("page") Page<NewsCategory> page, @Param("name") String name, @Param("orderByField") String orderByField,@Param("asc") boolean asc);

    /**
     * 根据themeId主题id获取它所有的类别对象
     */
    List<Map<String,Object>> getCategoriesByThemeId(@Param("themeId") Long themeId);
}
